<!DOCTYPE html>
<html>
<head>
    {% include 'zbook/common/header.html' %}
    <title>首页</title>
</head>
<body>
{% include 'zbook/common/topbar.html' %}
<!--具体内容-->
<div class="container bs-docs-container">
    <!--推荐小说-->
    <div class="clearfix">
        <div class="bs-example recommend-style col-sm-12 col-md-9 col-xs-12">
            <div class="Fiction-title"><i class="icon-tushu Fiction-icon"></i>推荐书籍</div>
            <div class="clearfix">
                {% for tb in data["top_books"] %}
                <div class="col-sm-6 col-md-3 col-xs-6">
                    <div class="thumbnail">
                        <a href="/catalog?bid={{tb.id}}" class="clearfix">
                            <div class="thumbnail-img">
                                {% if tb.img %}
                                <img data-src="holder.js/100%x200" alt="100%x200" src="{{ tb.img}}" data-holder-rendered="true" style=" width: 100%; display: block;">
                                {% else %}
                                <img data-src="holder.js/100%x200" alt="100%x200" src="/static/upload/default_img.png" data-holder-rendered="true" style=" width: 100%; display: block;">
                                {% endif %}
                                <h5 class=" author-name">作者：{{ tb.auth }}</h5>
                            </div>
                            <div class="caption">
                                <div class="book-title clearfix"><h4 class="navbar-left"> 《{{ tb.name}}》 </h4></div>
                                {% if tb.desc %}
                                <p class="Fiction-Introduction">{{ tb.desc }}</p>
                                {% else %}
                                <p class="Fiction-Introduction">《{{tb.name}}》作者是{{ tb.auth|truncate(7, True) }}，因为本书暂时还没有阅读过，等以后读过再填写书籍的介绍...</p>
                                {% endif %}
                            </div>
                            <span class="recommend-sheets">共 {{tb.sheets}} 章</span>
                        </a>
                    </div>
                </div>
                {% endfor %}
            </div>
            <!--书籍类型-->
            <div class="tags-list">
                {% for tag in data.tags %}
                <a href="/list?tid={{tag.tid}}" style="hover:none;" ><span class="tag tag-{{ tag.tid }}">{{ tag.tag }} / {{ tag.count }}</span></a>
                {% endfor %}
            </div>
        </div>
        <!--热门书籍 -->
        <div class="col-sm-12 col-md-3 col-xs-12">
            <div class="Fiction-title"><i class="icon-host Fiction-icon"></i>热门书籍</div>
            <ul class="clearfix hostlist">
                {% for hb in data.hot_books %}

                <li>
                    {% if hb.tid %}
                    <span class="Fiction-type label label-{{hb.tid}} navbar-left">{{ hb.tag }}</span>
                    {% else %}
                    <span class="Fiction-type label label-0 navbar-left">{{ hb.tag }}</span>
                    {% endif %}
                    <a href="/catalog?bid={{ hb.id }}" class="host-title navbar-left">《{{ hb.name }}》</a>
                    <span class="navbar-right host-name">{{ hb.auth[:3] }}</span>
                </li>
                {% endfor %}
            </ul>
        </div>
    </div>
    <div style="width:100%;height:15px;"></div>
    <!--筛选-->
    <div class="clearfix species-module">
        <div class="species-list clearfix">
            {% for tagbook in data.tag_books %}
            <div class="col-sm-12 col-md-4 col-xs-12">
                <div class="species-info">
                    <div class="Fiction-type-title tag-{{ tagbook.tid }} btn-default">{{ tagbook.tag }}书籍</div>
                    <div class="Fiction-filter">
                        <div class="Fiction-irst clearfix">
                            {% if tagbook.books.first_book %}
                            <a href="/catalog?bid={{ tagbook.books.first_book.id }}" class="clearfix">
                                <div class="Fiction-left-img">
                                    {% if tagbook.books.first_book.img %}
                                    <img src="{{ tagbook.books.first_book.img }}">
                                    {% else %}
                                    <img src="/_uploads/photos/default_img.png">
                                    {% endif %}
                                </div>
                                <div class="Fiction-right-content">
                                    <h4>《{{ tagbook.books.first_book.name }}》</h4>
                                    {% if tagbook.books.first_book.desc %}
                                    <p class="Fiction-Introduction">{{ tagbook.books.first_book.desc }}</p>
                                    {% else %}
                                        {% if tagbook.books.first_book.auth %}
                                        <p class="Fiction-Introduction">《{{tagbook.books.first_book.name}}》作者是{{ tagbook.books.first_book.auth|truncate(7, True) }}，因为本书暂时还没有阅读过，等以后读过再填写书籍的介绍...</p>
                                        {% else %}
                                        <p class="Fiction-Introduction">《{{tagbook.books.first_book.name}}》，因为本书暂时还没有阅读过，等以后读过再填写书籍的介绍...</p>
                                        {% endif %}
                                    {% endif %}
                                </div>
                            </a>
                            {% endif %}
                        </div>
                        <ul class="Fiction-list clearfix">
                            {% for tbk in tagbook.books.other_books %}
                            <li class="Fiction-name col-sm-12 col-md-6 col-xs-12"><a href="/catalog?bid={{ tbk.id }}">《{{ tbk.name }}》</a>/{{tbk.auth}}</li>
                            {% endfor %}
                        </ul>
                    </div>
                </div>
            </div>
            {% endfor %}
        </div>
    </div>
    <!--更新记录,最新入库-->
    <div class="clearfix newlist">
        <!--最新记录-->
        <div class="new-record col-sm-12 col-md-9 col-xs-12">
            <div class="Fiction-title"><i class="icon-news Fiction-icon"></i>最新阅读记录</div>
            <ul class="renew-Fiction-list">
                {% for rp in data.last_read %}
                <li class="renew-Fiction-info clearfix">
                    {% if rp.tid %}
                    <span class=" col-sm-12 col-md-1 col-xs-12"><a href="#" class="label label-{{rp.tid}} ">{{rp.tag}}</a></span>
                    {% else %}
                    <span class=" col-sm-12 col-md-1 col-xs-12"><a href="#" class="label label-0 ">{{rp.tag}}</a></span>
                    {% endif %}
                    <span class="book-name  col-sm-12 col-md-3 col-xs-12"><a href="/catalog?bid={{rp.bid}}">《{{ rp.name }}》</a></span>
                    <span class="Fiction-chapter  col-sm-12 col-md-4 col-xs-12"><a href="/read?bid={{rp.bid}}&pid={{rp.pid}}">{{ rp.title }}</a></span>
                    <span class=" col-sm-12 col-md-2 col-xs-12">{{ rp.realname }}</span>
                    <span class=" col-sm-12 col-md-2 col-xs-12">{{ rp.create_time | datetimeformat('%Y-%m-%d %H:%M:%S') }}</span>
                </li>
                {% endfor %}
            </ul>
        </div>
        <!--最新入库-->
        <div class="new-wareroom col-sm-12 col-md-3 col-xs-12">
            <div class="Fiction-title"><i class="icon-news Fiction-icon"></i>最新入库书籍</div>
            <ul class="clearfix hostlist">
                {% for bk in data.new_books %}
                <li>
                    {% if bk.tid %}
                    <span class="Fiction-type label label-{{bk.tid}} navbar-left">{{ bk.tag }}</span>
                    {% else %}
                    <span class="Fiction-type label label-0 navbar-left">{{ bk.tag }}</span>
                    {% endif %}
                    <a href="/catalog?bid={{ bk.id }}" class="host-title navbar-left">《{{ bk.name }}》</a>
                    {% if bk.auth %}
                        <span class="navbar-right host-name">{{ bk.auth[:3]}}</span>
                    {% endif %}
                </li>
                {% endfor %}
            </ul>
        </div>
    </div>
    <div class="Links">
        <div class="Fiction-title"><i class="icon-link Fiction-icon"></i>友情链接</div>
        <div class="Links-list">
            <a href="www.janl.top" class="Links-name">昆仑学苑</a>
        </div>
    </div>
</div>

{% include 'zbook/common/footer.html' %}
</body>
</html>
<script>
	/*********************************/
	var topnode = document.querySelector('#header-top');

	function change() {
		var bgheader = document.getElementById('integral-bgheader');
		var y = document.scrollingElement.scrollTop;
		bgheader.style.opacity = (((y / 50) > 0.9) ? 0.9 : (y / 50));
		if(y > 50) {
			topnode.classList.add("headerstyle");
		} else {
			topnode.classList.remove("headerstyle");
		}
	}
	document.addEventListener('touchmove', change);
	document.addEventListener('scroll', change);
	/**************搜索********************/
	function submit_search(){
		var name= $("#search-content").val();
		if(name!=''){
			window.location.href='/search?key='+name;
		}else{
			PromptBox('请输入查询信息!',2,false);
		}

	}

</script>